package keer.httpinterface.http;

import keer.httpinterface.utils.HttpInterfaceFactories;
import java.lang.reflect.Method;

public interface HttpRequestContextFactory {
    HttpRequestContext create(Class<?> interfaceClass,
                              Method interfaceMethod);

    static HttpRequestContextFactory getInstance() {
        try {
            return HttpInterfaceFactories.loadLastOneFactoryInstance(HttpRequestContextFactory.class.getClassLoader(),
                    HttpRequestContextFactory.class,
                    DefaultHttpRequestContextFactory::new);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
